package model;

import java.util.ArrayList;

public class SpriteSequence extends ObjectRepresentation {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2186014946676962605L;
	protected ArrayList<Sprite> sprites = new ArrayList<Sprite>();

	public SpriteSequence() {
		super();
	}
	
	public SpriteSequence(String id) {
		super();
		this.id = id;
	}

	public ArrayList<Sprite> getSprites() {
		return sprites;
	}

	public void setSprites(ArrayList<Sprite> sprites) {
		this.sprites = sprites;
	}

	@Override
	public String getId(int col, int row) {
		// TODO Auto-generated method stub
				for (Sprite sprite : sprites) {
					if (sprite.getConditionalColumn() != null
							&& sprite.getConditionalColumn() == col
							&& sprite.getConditionalRow() != null
							&& sprite.getConditionalRow() == row) {
						return sprite.id;
					}
				}
		return null;
	}
	
	@Override
	public String getPath(int col, int row) {
		// TODO Auto-generated method stub
		for (Sprite sprite : sprites) {
			if (sprite.getConditionalColumn() != null
					&& sprite.getConditionalColumn() == col
					&& sprite.getConditionalRow() != null
					&& sprite.getConditionalRow() == row) {
				return sprite.path;
			}
		}
		return null;
	}

}
